package com.cjy;

public class Phone  implements Comparable<Phone>{
    private Long phoneNumber;
    private Integer  time;
    private double  balance;

    public Phone() {
    }

    public Phone(Long phoneNumber, Integer time, double balance) {
        this.phoneNumber = phoneNumber;
        this.time = time;
        this.balance = balance;
    }

    public Long getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(Long phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public Integer getTime() {
        return time;
    }

    public void setTime(Integer time) {
        this.time = time;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    @Override
    public String toString() {
        return "Phone{" +
                "phoneNumber=" + phoneNumber +
                ", time=" + time +
                ", balance=" + balance +
                '}';
    }

    public int compareTo(Phone o) {
        return balance>o.balance?-1:1;
    }
}